<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html  class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/login.css">
    <link rel="stylesheet" href="css/xadmin.css">
     <style>
	body {
		background-color: #ddeef2 !important;
		 }
	</style>
</head>
<body class="login-bg">

<div class="login layui-anim layui-anim-up">
    <div class="message">新闻管理系统-用户注册</div>
    <div id="darkbannerwrap"></div>

   <form method="post" action="RegServlet?referer=<%= request.getParameter("referer")%>" class="layui-form" onsubmit="return validate()" accept-charset="UTF-8">
    <input name="username" id="username" placeholder="用户名" type="text" class="layui-input" required>
    <hr class="hr15">
    <input name="password" id="password" placeholder="密码" type="password" class="layui-input" required>
    <hr class="hr15">
    <input name="password1" id="password1" placeholder="确认密码" type="password" class="layui-input" required>
    <p id="tishi"></p>
    <hr class="hr20">
    <input value="注册" id="button" style="width:100%;" type="submit" onclick="comparePasswords()">
    <hr class="hr40" >
    <a href="log.jsp">已有账户？去登录</a>

    <script>
        function validate() {
            var password = document.getElementById("password");
            var password1 = document.getElementById("password1");
            var tishi = document.getElementById("tishi");

            if (password.value !== password1.value) {
                tishi.innerHTML = "两次输入的密码不一致，请重新输入！";
                tishi.style.color = "red";
                return false;
            } else {
                tishi.innerHTML = "两次输入的密码一致，可以提交！";
                tishi.style.color = "green";
                return true;
            }
        }
    </script>
</form>
</div>
</body>
</html>